package com.mrx.commons.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author Mr.X
 * @since 2023-01-12 20:31
 */
@Configuration
public class MinioConfig {

    @Resource
    private MinioProperties prop;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(prop.getEndpoint())
                .credentials(prop.getAccessKey(), prop.getSecretKey())
                .build();
    }

}
